#ifndef P1_H
#define P1_H
#include <iostream>
#include <vector> 
#include <fstream>
#include <stdlib.h>
#include <sstream>
#include <iterator>
#include <algorithm>

#define ITER 100000

#ifdef __amd64
inline uint64_t rdtsc(){
	uint32_t lo, hi;
	__asm__ __volatile__ (
	"xorl %%eax, %%eax\n"
	"cpuid\n"
	"rdtsc\n"
	: "=a" (lo), "=d" (hi)
	:
	: "%ebx", "%ecx" );
	return (uint64_t)hi << 32 | lo;
}
#endif


using namespace std;
typedef pair<pair<int,int>,int> xyp;


ostream& operator<<(ostream& os, const pair<int,int>& p);
template<class T>ostream& operator<<(ostream& os, const vector<T>& v);
void cargar(istringstream& is, int& k, int& base, int& altura, vector<int>& vx, vector<int>& vy, vector<pair<int,int> >& puntos);
xyp resolver(int& k, int& base, int& altura,  vector<pair<int,int> >& puntos);
bool enRango(const int& x, const int& y, const int& base, const int& altura, const pair<int,int>& punto);
void salida(ostream& out, xyp& sol);

#endif // P1_H
